﻿
using Bootstrap5.Abstractions;

using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Rendering;

namespace Bootstrap5;

[CssClass("nav")]
[HtmlTag("ul")]
public class Nav : BootstrapChildContentWithCascadingValueComponentBase<Nav>
{
    [Parameter] [CssClass("nav-")] public NavType? Type { get; set; }
    [Parameter] [CssClass("nav-fill")] public bool Fill { get; set; }
    [Parameter] [CssClass("nav-justified")] public bool Justified { get; set; }

    [Parameter] [CssClass("flex-column")] public bool Vertical { get; set; }

    [Parameter] public bool CardHeader { get; set; }

    protected override void CreateCssClass(ICssClassBuilder builder)
    {
        if (Type.HasValue)
        {
            builder.Add($"card-header-{Type.Value.GetEnumCssClass()}", CardHeader);
        }
    }
}
